# #  创建一个身份库
# #  用字典加列表创建库
# dic = {'i1': 312109010114, 'i2': 312109010115,
#        'i3': 312109010116, 'i4': 31210901010117, 'i5': 312109010118}
# ls = []
# # id = 1
# num = 0
# while num < 5:
#     safe = eval(input('验证身份，请输入你的学号：'))
#     if safe in dic.values():
#         support = input('请用英文输入法输入要投票的名字(A或B)：')
#         if support == 'A' or support == 'B':
#             ls.append(support)
#             # id += 1
#             num += 1
#         else:
#             print('你的输入有误请重新输入')
#     else:
#         print('你无投票权限')
# print('A的票数为：{};B的票数为：{}'.format(ls.count('A'), ls.count('B')))

# 用一个字典创建
dic = {'i1': 312109010114, 'i2': 312109010115,
       'i3': 312109010116, 'i4': 31210901010117, 'i5': 312109010118}
id = 1
num = 0
while num < 5:
    safe = eval(input('验证身份，请输入你的学号：'))
    if safe in dic.values():
        support = input('请用英文输入法输入要投票的名字(A或B)：')
        if support == 'A' or support == 'B':
            dic[id] = support
            id += 1
            num += 1
        else:
            print('你的输入有误请重新输入')
    else:
        print('你无投票权限')
x = 0
y = 0
for i in dic.values():
    if i == 'A':
        x += 1
    elif i == 'B':
        y += 1
print('A的票数为：{};B的票数为：{}'.format(x, y))
